package com.poi.exp.domain;

import java.util.List;

import com.poi.util.JackJsonUtil;

/**
 * 循环行
 * 
 * @author tarena
 *
 */
public class LoopRowModelVO extends RowModelVO {

	/**
	 * 序列化
	 */
	private static final long serialVersionUID = -2267308629833813064L;
	// list数据获取 key
	private String keyeExpression;
	// 嵌套循环
	private List<LoopRowModelVO> loopList;

	// 解析开始行
	private Integer lineBeginIndex;
	// 解析结束行
	private Integer lineEndIndex;
	/// 解析列开始
	private Integer columnBeginIndex;
	// 解析列结束
	private Integer columnEndIndex;

	public LoopRowModelVO() {
		super();
	}

	public LoopRowModelVO(List<BaseModel> cellList) {
		super(cellList);
	}

	public LoopRowModelVO(ModelType type) {
		super(type);
	}

	public String getKeyeExpression() {
		return keyeExpression;
	}

	public void setKeyeExpression(String keyeExpression) {
		this.keyeExpression = keyeExpression;
	}

	public Integer getLineBeginIndex() {
		return lineBeginIndex;
	}

	public void setLineBeginIndex(Integer lineBeginIndex) {
		this.lineBeginIndex = lineBeginIndex;
	}

	public Integer getLineEndIndex() {
		return lineEndIndex;
	}

	public void setLineEndIndex(Integer lineEndIndex) {
		this.lineEndIndex = lineEndIndex;
	}

	public Integer getColumnBeginIndex() {
		return columnBeginIndex;
	}

	public void setColumnBeginIndex(Integer columnBeginIndex) {
		this.columnBeginIndex = columnBeginIndex;
	}

	public Integer getColumnEndIndex() {
		return columnEndIndex;
	}

	public void setColumnEndIndex(Integer columnEndIndex) {
		this.columnEndIndex = columnEndIndex;
	}

	public List<LoopRowModelVO> getLoopList() {
		return loopList;
	}

	public void setLoopList(List<LoopRowModelVO> loopList) {
		this.loopList = loopList;
	}

	public Integer getLineNum() {
		if (null != this.getLineEndIndex() && null != this.getLineBeginIndex()) {
			lineNum = this.getLineEndIndex() - this.getLineBeginIndex()+1;
		}
		return lineNum;
	}

	public void setLineNum(Integer lineNum) {
		this.lineNum = lineNum;
	}

	@Override
	public String toString() {
		return JackJsonUtil.objToJson(this);
	}
}
